
import request from '@/utils/request'
const PREFIX = '/admin'
const USER_API = {
    register: (data)=>{
        return request({
            url: `${PREFIX}/register`,
            method: 'post',
            data:data
          })
    },
    list:(keyword,pageSize,pageNum)=>{
        return request({
            url:`${PREFIX}/list?keyword=${keyword}&pageSize=${pageSize}&pageNum=${pageNum}`,
            method:'get',
        })
    },
    delete:(id)=>{
        return request({
            url:`${PREFIX}/delete/${id}`,
            method:'get'
        })
    },
    update:(id,data)=>{
        return request({
            url:`${PREFIX}/update/${id}`,
            method:'post',
            data:data
        })
    },
    updateRole:(data)=>{
        return request({
            url:`${PREFIX}/role/update`,
            method:'post',
            data:data
        })
    },
    roleListAll:()=>{
        return request({
            url:`${PREFIX}/role/listAll`,
            method:'get'
        })
    },
    getRoleList:(id)=>{
        return request({
            url:`${PREFIX}/role/${id}`,
            method:'get'
        })
    },
}

export default USER_API